package vn.gamesv.hangman;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainGUIActivity extends Activity {

	Button fruits, body, animals, contries, things;
	Button sound;
	MediaPlayer mpPlayer;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main_gui);
		fruits = (Button)findViewById(R.id.btn_fruit);
		body = (Button)findViewById(R.id.btn_body);
		animals = (Button)findViewById(R.id.btn_animals);
		contries = (Button)findViewById(R.id.btn_contries);
		things = (Button)findViewById(R.id.btn_things);
		sound = (Button)findViewById(R.id.btn_sound);
		
		mpPlayer = MediaPlayer.create(MainGUIActivity.this, R.raw.music);
		mpPlayer.start();
		
		fruits.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainGUIActivity.this, FruitHangman.class);
				startActivity(intent);
			}
		});
		body.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(MainGUIActivity.this, BodyHangman.class);
				startActivity(intent);
			}
		});
		animals.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(MainGUIActivity.this, AnimalsHangman.class);
				startActivity(intent);
			}
		});
		things.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(MainGUIActivity.this,  ThingsHangman.class);
				startActivity(intent);
			}
		});
		contries.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(MainGUIActivity.this, ContriesHangman.class);
				startActivity(intent);
			}
		});
		sound.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				mpPlayer.pause();
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main_gui, menu);
		return true;
	}

}
